package com.xiaoq.shop.service.impl;

import com.xiaoq.shop.entity.ALiPayConfigEntity;
import com.xiaoq.shop.entity.WXPayConfigEntity;
import com.xiaoq.shop.repository.IPayConfigRepository;
import com.xiaoq.shop.service.IPayConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by chenjh on 2018/1/10.
 */
@Service
public class PayConfigServiceImpl implements IPayConfigService {

    @Autowired
    private IPayConfigRepository configRepository;

    @Override
    public boolean insertALiPayConfig(ALiPayConfigEntity configEntity) {
        return configRepository.insertALiPayConfig(configEntity);
    }


    @Override
    public ALiPayConfigEntity getALiPayConfigByShopId(String shopId) {
        return configRepository.getALiPayConfigByShopId(shopId);
    }

    @Override
    public boolean deleteAliPayConfigByShopId(String shopId) {
        return configRepository.deleteAliPayConfigByShopId(shopId);
    }


    @Override
    public boolean insertWXPayConfig(WXPayConfigEntity configEntity) {
        return configRepository.insertWXPayConfig(configEntity);
    }

    @Override
    public WXPayConfigEntity getWXPayConfigByShopId(String shopId, String wxPayType) {
        return configRepository.getWXPayConfigByShopId(shopId, wxPayType);
    }

    @Override
    public boolean deleteWXPayConfigByShopId(String shopId, String wxPayType) {
        return configRepository.deleteWXPayConfigByShopId(shopId, wxPayType);
    }
}
